home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Movie / Sources / MovieFra.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  17.0 KB  |  629 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                MovieFra.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef MOVIEFRA_H
  11. #include "MovieFra.h"
  12. #endif
  13.  
  14. #ifndef MOVIEPAR_H
  15. #include "MoviePar.h"
  16. #endif
  17.  
  18. #ifndef CMOVIE_H
  19. #include "CMovie.h"
  20. #endif
  21.  
  22. #ifndef MOVIESEL_H
  23. #include "MovieSel.h"
  24. #endif
  25.  
  26. // ----- Framework Includes -----
  27.  
  28. #ifndef FWITERS_H
  29. #include "FWIters.h"
  30. #endif
  31.  
  32. #ifndef FWUTIL_H
  33. #include "FWUtil.h"
  34. #endif
  35.  
  36. // ----- OS Layer Includes -----
  37.  
  38. #ifndef FWGRAPHX_H
  39. #include "FWGraphx.h"
  40. #endif
  41.  
  42. #ifndef FWMENU_H
  43. #include "FWMenu.h"
  44. #endif
  45.  
  46. #ifndef FWEVENT_H
  47. #include "FWEvent.h"
  48. #endif
  49.  
  50. #ifndef FWRESOUR_H
  51. #include "FWResour.h"
  52. #endif
  53.  
  54. #ifndef FWSTRING_H
  55. #include "FWString.h"
  56. #endif
  57.  
  58. #ifndef FWWINDOW_H
  59. #include "FWWindow.h"
  60. #endif
  61.  
  62. #ifndef FWCFMRES_H
  63. #include "FWCFMRes.h"
  64. #endif
  65.  
  66. #ifndef FWODGEOM_H
  67. #include "FWODGeom.h"
  68. #endif
  69.  
  70. #ifndef FWBARRAY_H
  71. #include "FWBArray.h"
  72. #endif
  73.  
  74. #ifndef FWMEMMGR_H
  75. #include "FWMemMgr.h"
  76. #endif
  77.  
  78. // ----- OpenDoc Includes -----
  79.  
  80. #ifndef SOM_ODFacet_xh
  81. #include <Facet.xh>
  82. #endif
  83.  
  84. #ifndef SOM_ODShape_xh
  85. #include <Shape.xh>
  86. #endif
  87.  
  88. #ifndef SOM_ODSession_xh
  89. #include <ODSessn.xh>
  90. #endif
  91.  
  92. #ifndef SOM_ODArbitrator_xh
  93. #include <Arbitrat.xh>
  94. #endif
  95.  
  96. #ifndef SOM_ODDispatcher_xh
  97. #include <Disptch.xh>
  98. #endif
  99.  
  100. #ifndef SOM_ODDragAndDrop_xh
  101. #include <DragDrp.xh>
  102. #endif
  103.  
  104. #ifndef SOM_ODDragItemIterator_xh
  105. #include <DgItmIt.xh>
  106. #endif
  107.  
  108. #ifndef SOM_Module_OpenDoc_StdProps_defined
  109. #include <StdProps.xh>
  110. #endif
  111.  
  112. #ifndef SOM_ODTranslation_xh
  113. #include <Translt.xh>
  114. #endif
  115.  
  116. // ----- Macintosh Includes -----
  117.  
  118. #if defined(FW_BUILD_MAC) && !defined(__DRAG__)
  119. #include <Drag.h>
  120. #endif
  121.  
  122. //========================================================================================
  123. //    Runtime Information
  124. //========================================================================================
  125.  
  126. #ifdef FW_BUILD_MAC
  127. #pragma segment odfmovie
  128. #endif
  129.  
  130. //========================================================================================
  131. //    CLASS CMovieFrame
  132. //========================================================================================
  133.  
  134. //----------------------------------------------------------------------------------------
  135. //     CMovieFrame::CMovieFrame
  136. //----------------------------------------------------------------------------------------
  137.  
  138. CMovieFrame::CMovieFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, 
  139.                          FW_CPart* part, CMovie* theMovie) :
  140.     FW_CFrame(ev, odFrame, presentation, part),
  141.     fMovie(NULL)
  142. {    
  143.     // Make a copy of the movie
  144.     if (theMovie)
  145.     {
  146.         fMovie = FW_NEW(CMovie, ());
  147.         *fMovie = *theMovie;
  148.     }
  149.     
  150.     this->SetDroppable(ev, TRUE);
  151. }
  152.  
  153. //----------------------------------------------------------------------------------------
  154. //     CMovieFrame::~CMovieFrame
  155. //----------------------------------------------------------------------------------------
  156.  
  157. CMovieFrame::~CMovieFrame()
  158. {
  159. }
  160.  
  161. //----------------------------------------------------------------------------------------
  162. //     CMovieFrame::Draw
  163. //----------------------------------------------------------------------------------------
  164.  
  165. void CMovieFrame::Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape)
  166. {
  167.     if (fMovie)
  168.     {
  169.         FW_CPlatformGraphicContext pgc(ev, odFacet);
  170.         
  171.         fMovie->Draw(odFacet->GetWindow(ev)->GetPlatformWindow(ev));
  172.     }
  173.     else
  174.     {
  175.         FW_CFacetContext fc(ev, odFacet, invalidShape);
  176.         
  177.         FW_CPictureShape::RenderPicture(fc, this->GetMoviePart(ev)->GetDefaultPicture(ev), GetBounds(ev));
  178.     }
  179. }
  180.  
  181. //----------------------------------------------------------------------------------------
  182. // CMovieFrame::FacetAdded
  183. //----------------------------------------------------------------------------------------
  184.  
  185. void CMovieFrame::FacetAdded(Environment* ev, ODFacet* facet)
  186. {
  187.     FW_CFrame::FacetAdded(ev, facet);
  188.     
  189.     if (!fMovie && this->GetMoviePart(ev)->GetInternalizedMovie(ev))
  190.     {
  191.         fMovie = FW_NEW(CMovie, ());
  192.         *fMovie = *(this->GetMoviePart(ev)->GetInternalizedMovie(ev));
  193.     }
  194.     
  195.     if (fMovie)
  196.     {
  197.         FW_CRect movieBox;
  198.         FW_CPlatformGraphicContext pgc(ev, facet);
  199.         FW_CAcquiredODWindow aqWindow(this->AcquireODWindow(ev));
  200.  
  201.         fMovie->SetGraphicsWorld(aqWindow->GetPlatformWindow(ev));
  202.         fMovie->SetLooping(this->GetMoviePart(ev)->IsLooping(ev));
  203.         fMovie->EnableKeys(TRUE);
  204.         fMovie->EnableEditing(TRUE);
  205.         fMovie->EnableDragging(FALSE);    // We take care of dragging ourselves so don't let the toolbox do it
  206.         fMovie->MakeControllerVisible(this->GetMoviePart(ev)->IsControllerShown(ev) || this->IsRoot(ev));
  207.         
  208.         fMovie->GetBoundingBox(movieBox);
  209.         movieBox.Offset(-movieBox.left, -movieBox.top);
  210.         this->AdjustFrameSize(ev, movieBox);
  211.         
  212.         if (this->IsRoot(ev))
  213.             this->GetWindow(ev)->SetWindowSize(ev, movieBox.BotRight());
  214.     
  215.         fMovie->Activate(aqWindow->GetPlatformWindow(ev), this->HasSelectionFocus(ev));
  216.     }
  217. }
  218.  
  219. //----------------------------------------------------------------------------------------
  220. // CMovieFrame::FrameShapeChanged
  221. //----------------------------------------------------------------------------------------
  222. void CMovieFrame::FrameShapeChanged(Environment* ev)
  223. {
  224.     FW_CFrame::FrameShapeChanged(ev);
  225.  
  226.     FW_CRect boundingBox = GetBounds(ev);
  227.     
  228.     FW_CFrameFacetIterator iter(ev, this);
  229.     for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  230.     {
  231.         if (fMovie)
  232.         {
  233.             FW_CPlatformGraphicContext pgc(ev, facet);
  234.             fMovie->SetBoundingBox(boundingBox);
  235.         }
  236.     }
  237.     
  238.     this->Invalidate(ev);    // Invalidate Frame shape
  239.     this->GetODFrame(ev)->InvalidateActiveBorder(ev);
  240. }
  241.  
  242. //----------------------------------------------------------------------------------------
  243. //     CMovieFrame::GeometryChanged
  244. //----------------------------------------------------------------------------------------
  245.  
  246. void CMovieFrame::GeometryChanged(Environment *ev,
  247.                                 ODFacet* odFacet,
  248.                                 FW_Boolean clipShapeChanged,
  249.                                 FW_Boolean externalTransformChanged)
  250. {
  251.     if (fMovie)
  252.     {
  253.         if (clipShapeChanged)
  254.         {
  255.             FW_CPlatformGraphicContext pgc(ev, odFacet);    
  256.         
  257.             FW_CAcquiredODShape aqODShape(odFacet->AcquireClipShape(ev, NULL));
  258.             ODRgnHandle clipRegion = ::FW_CopyRegion(aqODShape->GetQDRegion(ev));
  259.     
  260.             fMovie->SetClipShape(clipRegion);
  261.             ::FW_DisposeRegion(clipRegion);
  262.         }
  263.     }
  264. }
  265.  
  266. //----------------------------------------------------------------------------------------
  267. // CMovieFrame::FocusStateChanged
  268. //----------------------------------------------------------------------------------------
  269.  
  270. void CMovieFrame::FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner)
  271. {
  272.     FW_CFrame::FocusStateChanged(ev, focus, newState, newOwner);
  273.  
  274.     if ((focus == FW_CPart::gSelectionFocusToken) && fMovie)
  275.     {
  276.         ODFacet* facet = this->GetActiveFacet(ev);
  277.         if (facet)
  278.         {
  279.             FW_CPlatformGraphicContext pgc(ev, facet);
  280.             
  281.             fMovie->Activate(facet->GetWindow(ev)->GetPlatformWindow(ev), newState);
  282.         }
  283.     }
  284. }
  285.  
  286. //----------------------------------------------------------------------------------------
  287. // CMovieFrame::DoAdjustMenus
  288. //----------------------------------------------------------------------------------------
  289.  
  290. FW_Boolean CMovieFrame::DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot)
  291. {
  292.     ODTypeToken viewType = GetViewType(ev);
  293.     if (hasMenuFocus && (viewType == FW_CPart::gViewAsFrameToken))
  294.     {
  295.         menuBar->EnableCommand(ev, cShowMovieController, fMovie && !this->IsRoot(ev));
  296.         menuBar->EnableAndToggleCommand(ev, cStartStopMovie, fMovie != NULL, fMovie && fMovie->IsPlaying());
  297.  
  298.         menuBar->EnableAndCheckCommand(ev, cSetMovieLooping, TRUE,  this->GetMoviePart(ev)->IsLooping(ev));
  299.  
  300.         menuBar->EnableCommand(ev, cChooseMovie, TRUE);
  301.     }
  302.     
  303.     return FALSE;
  304. }
  305.  
  306. //------------------------------------------------------------------------------
  307. // CMovieFrame::DoMenu
  308. //------------------------------------------------------------------------------
  309.  
  310. FW_Boolean CMovieFrame::DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent)
  311. {
  312.     FW_Boolean menuHandled = TRUE;
  313.     
  314.     switch (theMenuEvent.GetCommandID(ev))
  315.     {
  316.         case cStartStopMovie:
  317.             {
  318.                 FW_CPlatformGraphicContext pgc(ev, this->GetActiveFacet(ev));
  319.                 
  320.                 if (!fMovie->IsPlaying())
  321.                     fMovie->Start();
  322.                 else
  323.                     fMovie->Stop();
  324.             }
  325.             
  326.             break;
  327.                 
  328.         default:
  329.             menuHandled = FALSE;
  330.     }            
  331.     
  332.     return menuHandled;
  333. }
  334.  
  335. //---------------------------------------------------------------------------------------
  336. // CMovieFrame::DoMouseDown
  337. //----------------------------------------------------------------------------------------
  338.  
  339. FW_Boolean CMovieFrame::DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent)
  340. {
  341.     FW_Boolean eventHandled = FALSE;
  342.     
  343.     if (fMovie)
  344.     {
  345.         FW_CPlatformGraphicContext pgc(ev, theMouseEvent.GetFacet(ev));
  346.         
  347.         eventHandled = fMovie->DoMouseDown(ev, theMouseEvent);
  348.         
  349.         if (!fMovie->IsSelectionEmpty())
  350.             this->Drag(ev, theMouseEvent);
  351.     }
  352.     
  353.     return eventHandled;
  354. }
  355.  
  356. //----------------------------------------------------------------------------------------
  357. // CMovieFrame::DoVirtualKeyDown
  358. //----------------------------------------------------------------------------------------
  359.  
  360. FW_Boolean CMovieFrame::DoVirtualKeyDown(Environment* ev, const FW_CVirtualKeyEvent& theVirtualKeyEvent)
  361. {
  362.     if (fMovie)
  363.     {
  364.         FW_CPlatformGraphicContext pgc(ev, this->GetActiveFacet(ev));
  365.         
  366.         return fMovie->DoVirtualKeyDown(ev, theVirtualKeyEvent);
  367.     }
  368.     else
  369.         return FALSE;
  370. }
  371.  
  372. //----------------------------------------------------------------------------------------
  373. // CMovieFrame::CanAcceptDrop
  374. //----------------------------------------------------------------------------------------
  375.  
  376. ODDragResult CMovieFrame::CanAcceptDrop(Environment *ev, ODDragItemIterator* dragInfo)
  377. {
  378.     ODDragResult result = FW_CFrame::CanAcceptDrop(ev, dragInfo);
  379.     
  380.     if (!result)
  381.     {
  382.         ODStorageUnit *dragSU;
  383.         HFSFlavor *valueData;
  384.         long valueSize;
  385.         
  386.         ODTranslation *translate = this->GetPart(ev)->GetSession(ev)->GetTranslation(ev);
  387.         ODType typeHFS = translate->GetISOTypeFromPlatformType(ev, 'hfs ', kODPlatformDataType);
  388.         ODType typePICT = translate->GetISOTypeFromPlatformType(ev, 'PICT', kODPlatformDataType);
  389.  
  390.         dragSU = dragInfo->First(ev);
  391.         while (dragSU != NULL && !result)
  392.         {
  393.             if (fMovie && (dragSU->Exists(ev, kODPropContents, typePICT, 0)))
  394.             {
  395.                 result = TRUE;
  396.             }
  397.             else if (dragSU->Exists(ev, kODPropContents, typeHFS, 0))
  398.             {
  399.                 dragSU->Focus(ev, kODPropContents, kODPosUndefined, typeHFS, 0, kODPosUndefined);
  400.                 valueSize = dragSU->GetSize(ev);    
  401.                 if (valueSize)
  402.                 {                    
  403.                     FW_CByteArray byteArray;
  404.                     valueSize = dragSU->GetValue(ev, valueSize, byteArray);
  405.                     valueData = (HFSFlavor*) FW_CMemoryManager::AllocateBlock(valueSize);
  406.                     byteArray.CopyBuffer(valueData, valueSize);
  407.                     
  408.                     result = valueData->fileType == 'MooV';
  409.                         
  410.                     FW_CMemoryManager::FreeBlock(valueData);
  411.                 }
  412.             }
  413.             
  414.             dragSU = dragInfo->Next(ev);
  415.         }
  416.     }
  417.     
  418.     return result;
  419. }
  420.  
  421. //----------------------------------------------------------------------------------------
  422. // CMovieFrame::AdjustFrameSize
  423. //----------------------------------------------------------------------------------------
  424.  
  425. void CMovieFrame::AdjustFrameSize(Environment* ev, const FW_CRect& movieBox)
  426. {
  427.     FW_CRect frameRect = GetBounds(ev);
  428.     frameRect.Place(FW_kZeroPoint);
  429.     
  430.     if (frameRect != movieBox)
  431.     {
  432.         FW_CAcquiredODShape aqTempShape(::FW_NewODShape(ev, movieBox));
  433.         if (!this->RequestFrameShape(ev, aqTempShape))
  434.         {
  435.             fMovie->SetBoundingBox(frameRect);
  436.             Invalidate(ev);
  437.         }
  438.     }
  439. }
  440.  
  441. //----------------------------------------------------------------------------------------
  442. //     CMovieFrame::AdoptNewMovie
  443. //----------------------------------------------------------------------------------------
  444.  
  445. void CMovieFrame::AdoptNewMovie(Environment* ev, CMovie* newMovie)
  446. {
  447.     if (fMovie)
  448.         delete fMovie;
  449.     
  450.     fMovie = newMovie;
  451.     this->GetPart(ev)->Changed(ev);    // document has changed
  452.     
  453.     FW_CPlatformGraphicContext pgc(ev, this->GetActiveFacet(ev));
  454.     FW_CAcquiredODWindow aqWindow(this->AcquireODWindow(ev));
  455.     
  456.     fMovie->SetGraphicsWorld(aqWindow->GetPlatformWindow(ev));
  457.     fMovie->SetLooping(this->GetMoviePart(ev)->IsLooping(ev));
  458.     fMovie->EnableKeys(TRUE);
  459.     fMovie->EnableEditing(TRUE);
  460.     fMovie->EnableDragging(FALSE);    // We take care of dragging ourselves so don't let the toolbox do it
  461.     fMovie->MakeControllerVisible(this->GetMoviePart(ev)->IsControllerShown(ev) || this->IsRoot(ev));
  462.     
  463.     FW_CRect movieBox;    
  464.     fMovie->GetBoundingBox(movieBox);
  465.     movieBox.Place(FW_kZeroPoint);
  466.     
  467.     if (!this->IsRoot(ev))
  468.         this->AdjustFrameSize(ev, movieBox);
  469.     else
  470.         this->GetWindow(ev)->SetWindowSize(ev, movieBox.BotRight());
  471.  
  472.     fMovie->Activate(aqWindow->GetPlatformWindow(ev), this->HasSelectionFocus(ev));
  473. }
  474.  
  475. //----------------------------------------------------------------------------------------
  476. //     CMovieFrame::UpdateMovie
  477. //----------------------------------------------------------------------------------------
  478.  
  479. void CMovieFrame::UpdateMovie(Environment* ev)
  480. {    
  481.     ODTypeToken viewType = GetViewType(ev);
  482.  
  483.     if (fMovie && (viewType == FW_CPart::gViewAsFrameToken))
  484.     {
  485.         FW_CFrameFacetIterator iter(ev, this);
  486.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  487.         {
  488.             FW_CPlatformGraphicContext pgc(ev, facet);
  489.             fMovie->Idle();
  490.         }
  491.     }
  492. }
  493.  
  494. //----------------------------------------------------------------------------------------
  495. //     CMovieFrame::ToggleLooping
  496. //----------------------------------------------------------------------------------------
  497.  
  498. void CMovieFrame::ToggleLooping(Environment* ev, FW_Boolean looping)
  499. {
  500.     if (fMovie)
  501.         fMovie->SetLooping(looping);
  502. }
  503.  
  504. //----------------------------------------------------------------------------------------
  505. //     CMovieFrame::ToggleController
  506. //----------------------------------------------------------------------------------------
  507.  
  508. void CMovieFrame::ToggleController(Environment* ev, FW_Boolean showController)
  509. {
  510.     if (fMovie)
  511.     {
  512.         FW_CFrameFacetIterator iter(ev, this);
  513.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  514.         {
  515.             FW_CRect movieBox;
  516.             
  517.             fMovie->MakeControllerVisible(showController);
  518.             fMovie->GetBoundingBox(movieBox);
  519.             this->AdjustFrameSize(ev, movieBox);
  520.             this->GeometryChanged(ev, facet, TRUE, FALSE);
  521.         }
  522.     }
  523. }
  524.  
  525. //----------------------------------------------------------------------------------------
  526. // CMovieFrame::CloseSelection
  527. //----------------------------------------------------------------------------------------
  528.  
  529. void CMovieFrame::CloseSelection(Environment* ev)
  530. {
  531.     if (fMovie)
  532.     {
  533.         FW_CFrameFacetIterator iter(ev, this);
  534.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  535.         {
  536.             FW_CPlatformGraphicContext pgc(ev, facet);
  537.             
  538.             fMovie->CloseSelection();
  539.         }
  540.     }
  541. }
  542.  
  543. //----------------------------------------------------------------------------------------
  544. // CMovieFrame::ClearSelection
  545. //----------------------------------------------------------------------------------------
  546.  
  547. void CMovieFrame::ClearSelection(Environment* ev)
  548. {
  549.     if (fMovie)
  550.     {
  551.         FW_CFrameFacetIterator iter(ev, this);
  552.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  553.         {
  554.             FW_CPlatformGraphicContext pgc(ev, facet);
  555.             
  556.             fMovie->ClearCurrentSelection();
  557.         }
  558.     }
  559. }
  560.  
  561. //----------------------------------------------------------------------------------------
  562. // CMovieFrame::SelectAll
  563. //----------------------------------------------------------------------------------------
  564.  
  565. void CMovieFrame::SelectAll(Environment* ev)
  566. {
  567.     if (fMovie)
  568.     {
  569.         FW_CFrameFacetIterator iter(ev, this);
  570.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  571.         {
  572.             FW_CPlatformGraphicContext pgc(ev, facet);
  573.             
  574.             fMovie->SelectAll();
  575.         }
  576.     }
  577. }
  578.  
  579. //----------------------------------------------------------------------------------------
  580. // CMovieFrame::IsSelectionEmpty
  581. //----------------------------------------------------------------------------------------
  582.  
  583. FW_Boolean CMovieFrame::IsSelectionEmpty(Environment* ev)
  584. {
  585.     FW_Boolean empty = TRUE;
  586.     
  587.     if (fMovie)
  588.         empty = fMovie->IsSelectionEmpty();
  589.         
  590.     return empty;
  591. }
  592.  
  593. //----------------------------------------------------------------------------------------
  594. // CMovieFrame::PasteMovieToSelection
  595. //----------------------------------------------------------------------------------------
  596.  
  597. void CMovieFrame::PasteMovieToSelection(Environment* ev, CMovie* newMovie)
  598. {
  599.     if (fMovie)
  600.     {
  601.         FW_CFrameFacetIterator iter(ev, this);
  602.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  603.         {
  604.             FW_CPlatformGraphicContext pgc(ev, facet);
  605.             
  606.             fMovie->PasteMovieToCurrentSelection(newMovie);
  607.         }
  608.     }
  609. }
  610.  
  611. //----------------------------------------------------------------------------------------
  612. // CMovieFrame::PasteHandleToSelection
  613. //----------------------------------------------------------------------------------------
  614.  
  615. void CMovieFrame::PasteHandleToSelection(Environment* ev, FW_PlatformHandle newHandle, OSType handleType)
  616. {
  617.     if (fMovie)
  618.     {
  619.         FW_CFrameFacetIterator iter(ev, this);
  620.         for (ODFacet* facet = iter.First(ev); iter.IsNotComplete(ev); facet = iter.Next(ev))
  621.         {
  622.             FW_CPlatformGraphicContext pgc(ev, facet);
  623.             
  624.             fMovie->PasteHandleToCurrentSelection(newHandle, handleType);
  625.         }
  626.     }
  627. }
  628.  
  629.